package com.hlx.project.service;

import com.hlx.project.model.dto.team.*;
import com.hlx.project.model.entity.Team;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hlx.project.model.entity.User;
import com.hlx.project.model.vo.TeamUserVO;
import org.springframework.transaction.annotation.Transactional;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @author HlX
* @description 针对表【team(队伍)】的数据库操作Service
* @createDate 2022-12-14 15:53:14
*/
public interface TeamService extends IService<Team> {
    Long addTeam(Team team, User loginUser);


    List<TeamUserVO> listTeam(TeamQueryRequest teamQueryRequest, boolean isAdmin);

    boolean updateTeam(TeamUpdateRequest teamUpdateRequest, HttpServletRequest request);

    boolean joinTeam(TeamJoinRequest teamJoinRequest, HttpServletRequest request);

    boolean quitTeam(TeamQuitRequest teamQuitRequest, HttpServletRequest request);

    @Transactional(rollbackFor = Exception.class)
    boolean deleteTeam(long id, User loginUser);

    List<TeamUserVO> listTeams(TeamQuery teamQuery, boolean b);
}
